package org.example;

import cn.hserver.plugin.web.annotation.WebSocket;
import cn.hserver.plugin.web.handlers.Ws;
import cn.hserver.plugin.web.interfaces.WebSocketHandler;

@WebSocket("/ws")
public class WebSocketTest implements WebSocketHandler {
    @Override
    public void onConnect(Ws ws) {
        System.out.println("onConnect"+ws.getUid());
    }

    @Override
    public void onMessage(Ws ws) {

        ws.send("aa");

    }

    @Override
    public void disConnect(Ws ws) {
        System.out.println("disConnect"+ws.getUid());
    }
}
